package com.p2p.auth.domain.entity;

import com.p2p.auth.common.enums.OperationEvent;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 *
 * @author Antinomy
 * @date 17/12/11
 */
@Entity
@Table(name = "t_operation_log")
@DynamicInsert
@DynamicUpdate
@EntityListeners(AuditingEntityListener.class)
@Data
public class OperationLog extends IdEntity {

    private static final long serialVersionUID = 4725335360949023103L;
    @Column(columnDefinition = "varchar(100) NOT NULL comment '操作用户ID'")
    private String operatorId;

    @Column(columnDefinition = "varchar(50) comment '操作人'")
    private String operatorName;

    @Column(columnDefinition = "varchar(100) comment '操作人手机'")
    private String operatorMobile;

    @Column(columnDefinition = "longtext comment '事件请求Json'")
    private String eventRequestJson;

    @Column(columnDefinition = "varchar(50) NOT NULL comment '主事件类型'")
    @Enumerated(EnumType.STRING)
    private OperationEvent event;

    @Column(columnDefinition = "varchar(100)comment '事件详情'")
    private String eventDesc;

    @Column(columnDefinition = "varchar(50) comment '客户终端的IP 地址'")
    private String terminalIP;

    @Column(columnDefinition = "varchar(100) comment '操作项名'")
    private String operateItemName;

    @Column(columnDefinition = "varchar(22) comment '操作项Id'")
    private String operateItemId;

}